﻿@*<!DOCTYPE html>*@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>土地信息管理系统</title>
    @{
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")

        Dictionary<string, string> dic = new Dictionary<string, string>();
        dic.Add("数据录入", "#m1");
        dic.Add("数据修改", "#m2");
        dic.Add("数据查询", "#m3");
        dic.Add("数据统计", "#m4");
        dic.Add("数据报表", "#m5");
        dic.Add("系统管理", "#m6");

        var key = string.Empty;
        try
        {
            string tmp = ViewBag.Menu;
            key = string.IsNullOrEmpty(tmp) ? string.Empty : dic[tmp];

        }
        catch (Exception)
        {
            key = string.Empty;
        }


        var CurrentUser = this.Session["_UserInfo"] as LandManager.Web.Models.UserInfo;
        if (CurrentUser == null)
        {
            //Response.RedirectToRoute("Default", null);
            Response.Redirect("/User/Login");
            return;
        }

    }

    <script type="text/javascript" src="~/Scripts/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="~/Scripts/AddorDel.js"></script>
    <script type="text/javascript" src="~/Scripts/jquery.PrintArea.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            var menuDiv = ["#m1", "#m2", "#m3", "#m4", "#m5", "#m6"];
            for (var i = 0, length = menuDiv.length; i < length; i++) {
                var divEls = $(menuDiv[i]);
                divEls[0].onmousedown = function () {
                    //鼠标按下的时候触发
                    //替换this对象的背景色 #004b97
                    this.style.background = "#a6acae";
                    //替换图片
                    var divElsImg = this.children[0];
                    var divElsText = this.children[1];
                    divElsImg.src = divElsImg.src.replace(/u.jpg/, "p.jpg");
                    divElsText.style.background = "#a6acae";
                    divElsText.style.color = "black";
                    //替换其他对象的背景为原色 #808080
                    var lmenuDiv = ["#m1", "#m2", "#m3", "#m4", "#m5", "#m6"];

                    for (var i = 0, mlength = lmenuDiv.length; i < mlength; i++) {
                        var divEls = $(lmenuDiv[i]);
                        var tarDiv = divEls[0];
                        if (tarDiv.id != this.id) {
                            tarDiv.style.background = "#fff";
                            var tElsImg = tarDiv.children[0];
                            var tElsText = tarDiv.children[1];
                            tElsImg.src = tElsImg.src.replace(/p.jpg/, "u.jpg");
                            tElsText.style.background = "#fff";
                            tElsText.style.color = "#a6acae";
                        }
                    }

                    var divNum = this.id;
                    divNum = divNum.substr(1, 1);
                    //展示对应的ul
                    $("#side").css("display", "block");
                    var ulEls = $("#side").find("ul");
                    var uiTitle = $("#side").find("div");
                    for (var ll = 0; ll < ulEls.length; ll++) {
                        var tarUl = ulEls[ll];
                        var ulNum = tarUl.id;
                        ulNum = ulNum.substr(1, 1);

                        if (divNum == ulNum) {
                            uiTitle[ll].style.display = "block";
                            tarUl.style.display = "block";
                        }
                        else {
                            tarUl.style.display = "none";
                            uiTitle[ll].style.display = "none";
                        }
                        
                    }

                }
            }

            $('@key').trigger("onmousedown");
        });
    </script>
    <!-- //框架布局样式-->
    <style type="text/css">
        html, body {
            overflow: auto;
            height: 100%;
            margin: 0;
            padding: 0;
            background: #DADADA;
            font-family: 'Microsoft YaHei';
            /*font-size: 10pt;*/
            color: #000;
        }

        html {
            _padding: 110px 0;
        }

        #hd {
            /*top: 0;
            left: 0;*/
            width: 1280px;
            height: 95px;
            margin-left: auto;
            margin-right: auto;
            background: #2573c7;
            min-width: 700px;
            min-height: 68px;
        }

        #md {
            /*left: 0;*/
            width: 1280px;
            height: 85px;
            _width: 1280px;
            _height: 85px;
            margin-left: auto;
            margin-right: auto;
            background: #fff;
            /*min-width: 700px;
            min-height: 73px;*/
            /*position:relative;*/
        }

        #testdiv {
            width: 1280px;
            height: 19px;
            margin-left: auto;
            margin-right: auto;
            background: #C5C5C5;
        }

        #bd {
            background: #C5C5C5;
            /*overflow: hidden;*/
            width: 1280px;
            margin-left: auto;
            margin-right: auto;
            height: auto;
            min-height: 740px;
        }

        #main {
            float: right;
            /*margin-top: 0;
            margin-bottom: 0;*/
            border: none;
            height: 740px;
            width: 83%;
            background: #F2F2F2;
            /*background: #fff;*/
            /*background: #ff6a00;*/
        }

        #pageTag {
            height: 105px;
            width: 100%;
            /*background: #2573c7;*/
        }

        #side {
            float: left;
            /*padding-left: -1em;*/
            border: none;
            overflow: auto;
            /*width: 200px;*/
            width: 15%;
            height: 740px;
            background: #282828;
            /*min-height: 740px;*/
            /*border: solid 1px #393b3b;*/
            color: #a6acae;
        }

            #side div {
                margin-top: 5px;
                display: none;
                font-size: 15pt;
                border-bottom: solid 1px #a6acae;
                background: #282828;
                width: 85%;
                height: 28px;
                margin: auto auto;
                padding-top: 15px !important;
                padding-top: 18px;
                padding-bottom: 15px;
                padding-left: 18px;
            }

            #side ul {
                display: none;
                width: 70%;
                margin: auto auto;
                border: none;
                padding-left: 10px;
            }

                #side ul li {
                    border: none;
                    color: #a6acae;
                    margin-top: 8px;
                    margin-bottom: 8px;
                    /*margin-left:0px;*/
                    padding-left: 5px;
                    padding-right: 15px;
                    padding-bottom: 2px;
                    padding-top: 5px;
                    list-style: none;
                }

                    #side ul li a {
                        /*color: white;*/
                        text-decoration: none;
                        color: #a6acae;
                    }

        /*#side ul li a:hover {
                            color: #2573c7;
                            text-decoration: none;
                            font-weight: normal;
                        }*/

        #content {
            /*overflow-x: hidden;
            overflow-y: auto;*/
            overflow: auto;
            width: 100%;
            height: 100%;
        }

        .annormalStyle {
            text-decoration: none;
            color: #a6acae;
        }

        /*.hoverStyle {
            color: #2573c7;
            text-decoration: none;
            font-weight: normal;
        }*/
    </style>

    <!-- 菜单样式-->
    <style type="text/css">
        .m6 {
            float: left;
            /*display: inline;*/
            width: 110px;
            height: 100%;
            text-align: center;
            /*position: relative;*/
        }

        .menuImg {
            width: 40px;
            height: 40px;
            margin-right: auto;
            margin-top: 10px;
            margin-left: auto;
        }

        .menuText {
            font-family: 'Microsoft YaHei';
            height: 20px;
            margin-left: auto;
            margin-right: auto;
            margin-bottom: 10px;
            color: #a6acae;
            font-size: 10pt;
        }

        #menuUsr {
            /*position: relative;*/
            height: 100%;
            width: 30%;
            float: right;
            text-align: center;
            margin-right: 40px;
        }

            #menuUsr table {
                margin: auto auto;
                width: 300px;
                height: 100%;
                margin-left: 20%;
            }

        .menuUsrtd1 {
            width: 60px;
            text-align: right;
        }

        .menuUsrtd2 {
            width: 180px;
        }

        .menuUsrtd3 {
            width: 60px;
        }

        .menuUsrIcon {
            width: 28px;
            height: 24px;
            margin: auto auto;
        }

        .menuUsrText {
            height: 22px;
            line-height: 22px;
            width: 180px;
            margin: auto auto;
            vertical-align: central;
            border: thin solid #a6acae;
        }

        .menuLoginOut {
            width: 25px;
            height: 25px;
            margin: auto auto;
            background-color: transparent;
            border: 0;
            background-image: url('/Images/reg.png');
            background-repeat: no-repeat;
        }

        .loader {
            margin: 20% auto auto auto;
            width: 150px;
            height: 40px;
            background: #2573c7;
            color: #0ce524;
            text-align: center;
            vertical-align: central;
        }

        #md a div img {
            border: 0 none;
        }
    </style>


    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

    <script type="text/javascript">
        var app = '@Request.ApplicationPath';
        if (app.charAt(app.length - 1) == '/') app = app.substr(0, app.length - 1);
    </script>
</head>
<body>

    <div id="hd">
        <img src="~/Images/header.png" />
    </div>

    <div id="md">
        <a href="~/Land/Import">
            <div id="m1" class="m6">
                <img src="~/Images/Au.jpg" class="menuImg" /><div class="menuText">
                    数据录入
                </div>
            </div>
        </a>
        <a href="~/Land/Index">
            <div id="m2" class="m6">
                <img src="~/Images/Bu.jpg" class="menuImg" /><div class="menuText">
                    数据修改
                </div>
            </div>
        </a>
        <a href="~/Land/Search">
            <div id="m3" class="m6">
                <img src="~/Images/Cu.jpg" class="menuImg" /><div class="menuText">
                    数据查询
                </div>
            </div>
        </a>
        <a href="~/Home/Welcome">
            <div id="m4" class="m6">
                <img src="~/Images/Du.jpg" class="menuImg" /><div class="menuText">
                    数据统计
                </div>
            </div>
        </a>
        <a href="~/Land/Report/0">
            <div id="m5" class="m6">
                <img src="~/Images/Eu.jpg" class="menuImg" /><div class="menuText">
                    数据报表
                </div>
            </div>
        </a>

        @{
    if (CurrentUser != null && CurrentUser.user_isAdmin == 1)
    {<a href="~/User/Index">
        <div id="m6" class="m6">
            <img src="~/Images/Gu.jpg" class="menuImg" /><div class="menuText">系统管理</div>
        </div>
    </a>
    }
    else
    {<a href="~/User/Index">
        <div id="m6" style="display:none">
            <img src="~/Images/Gu.jpg" class="menuImg" /><div class="menuText">系统管理</div>
        </div>
    </a>
    }
}
        <div id="menuUsr">
            <table>
                <tr>
                    <td class="menuUsrtd1">
                        <img src="~/Images/usericon.png" class="menuUsrIcon" />
                    </td>
                    <td class="menuUsrtd2">
                        <input id="Text1" type="text" value="你好：@CurrentUser.user_name" class="menuUsrText" readonly="readonly" />
                    </td>
                    <td class="menuUsrtd3">
                        <input id="login_out" type="button" value="" class="menuLoginOut" />
                    </td>
                </tr>
            </table>
        </div>
        <input id="lastUrl" type="hidden" value="lastUrl" /><input id="currentUrl" type="hidden" value="currentUrl" onchange="alert('current changed')" />
    </div>
    <div id="testdiv"></div>
    <div id="bd">
        <div id="side" oncontextmenu="return false;">
            <div>数据录入</div>
            <ul id="p1">
                <li>@Html.ActionLink("批量录入", "Import", "Land")</li>
                <li>@Html.ActionLink("单条录入", "Create", "Land")</li>
            </ul>
            <div>数据修改</div>
            <ul id="p2">
                <li>@Html.ActionLink("土地资源列表", "Index", "Land")</li>
            </ul>
            <div>数据查询</div>
            <ul id="p3">
                <li>@Html.ActionLink("数据查询", "Search", "Land")</li>
            </ul>
            <div>数据统计</div>
            <ul id="p4">
                <li>@Html.ActionLink("信息统计", "Welcome", "Home")</li>
                <li>@Html.ActionLink("数据统计", "Statistic", "Land")</li>
            </ul>
            <div>数据报表</div>
            <ul id="p5">
                <li><a href="~/Land/Report/0">新增土地报表</a></li>
                <li><a href="~/Land/Report/1">处置土地报表</a></li>
            </ul>

            <div>系统管理</div>
            <ul id="p6">
                <li>@Html.ActionLink("用户管理", "Index", "User")</li>
                <li>@Html.ActionLink("二级单位管理", "Index", "Agency")</li>
            </ul>
        </div>
        <div id="main">
            @RenderSection("scripts", required: false)
            @Scripts.Render("~/bundles/jquery")
            @RenderBody()
        </div>
    </div>



</body>
</html>
